package com.pai4j.common.enums.messagequeue;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 *  消息队列枚举类
 *
 * @author: CYM-pai
 * @date: 2025/04/29 20:18
 **/

@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum MessageQueueEnum {

    QUEUE_CHATTING_LIST_REFRESH("queue_chatting_list_refresh", "聊天对话列表刷新队列"),
    
    QUEUE_CHATTING_LIST_REMOVE("queue_chatting_list_remove", "聊天对话列表移除队列"),
    
    QUEUE_SUBSCRIBE_LIST_REFRESH("queue_subscribe_list_refresh",  "订阅列表刷新队列"),

    QUEUE_CHAT_MESSAGE("queue_chat_message", "聊天消息队列"),

    QUEUE_SUBJECT_ARTICLE_PUSH_MESSAGE("queue_subject_article_push_message", "文章栏专题文章"),

    QUEUE_PERSISTENT_CHAT_MESSAGE("queue_persistent_chat_message", "聊天消息持久化队列"),

    QUEUE_PERSISTENT_INTERACTION_MESSAGE("queue_persistent_interaction_message", "互动消息持久化队列"),

    QUEUE_CHAT_VIDEO_P2P("queue_chat_video_p2p", "P2P（一对一）音视频聊天信令消息队列"),

    QUEUE_CHAT_VIDEO_MESH("queue_chat_video_mesh", "基于Mesh模式的多人音视频聊天信令消息队列"),

    QUEUE_MOMENT_PUBLISH("queue_moment_publish", "朋友圈动态发布消息队列"),

    QUEUE_SYNC_SEARCH_DB_MESSAGE("queue_sync_search_db_message","同步搜索服务存储队列" ),

    QUEUE_MESSAGE_SYNC_ES("queue_message_sync_es","聊天消息同步搜索队列" ),

    QUEUE_ACCOUNT_SYNC_ES("queue_account_sync_es","账号信息同步搜索队列"),
    
    QUEUE_SUBJECT_ARTICLE_SYNC_ES("queue_subject_article_sync_es","专题文章同步搜索队列"),
    
    QUEUE_MOMENT_SYNC_ES("queue_moment_sync_es","π圈动态同步搜索队列");

    private String queue;

    private String queueName;
    
    
    
    
    /**
     * 根据队列topic名称获取枚举对象
     *
     * @param queue
     * @return
     */
    public static MessageQueueEnum getByQueue(String queue) {
        for (MessageQueueEnum messageQueueEnum : MessageQueueEnum.values()) {
            if (messageQueueEnum.getQueue().equals(queue)) {
                return messageQueueEnum;
            }
        }
        return null;
    }
}
